In the context of indexes, a bitmap is a series of bits associated with both a body of records and a particular criteria. Each bit in the bitmap corresponds to one of the records in the body of records and serves as a flag to indicate whether the corresponding record satisfies the criteria associated with the bitmap. Typically, a bitmapped index contains one bitmap for each unique value stored in a particular column of a table, with each bit of the bitmap indicating whether a corresponding row of the table contains the unique value in the particular column.
Bitmapped indexes are useful tools for processing database queries because they can increase query processing performance while requiring relatively little storage space. However, for bitmapped indexes to remain valid, they must always accurately reflect the data upon which the bitmapped indexes are based. This means that bitmapped indexes must be updated whenever a change is made to the data upon which the bitmapped indexes are based. For a small number of changes, updating the associated bitmapped indexes may not require significant system resources. For example, some types of database queries, such as individual inserts and deletes, only require a few database changes, which are easily reflected in a bitmapped index.
On the other hand, some types of database queries, such as bulk data manipulation language (DML) statements, generate a large number of database changes which must be reflected in all associated bitmapped indexes for those bitmapped indexes to remain valid. Updating each of the bitmapped indexes to reflect a large number of changes to data upon which the bitmapped indexes are based can require significant system resources. This is particularly true when the results of a database query are not related to the physical arrangement of the bitmapped index data on disk. As a result, all of the bitmap changes for a particular bitmap may not all be applied at once, requiring some bitmaps to be updated many times. Each time a bitmap is to be updated, the bitmap must be read into memory, updated and written to back disk. In addition, each bitmap update requires that a lock be obtained on the bitmapped index entry containing the bitmap to be updated before the change is applied and then that the lock is released after the change is applied.
In view of both the benefits provided by bitmapped indexes and the resources required to update bitmapped indexes to reflect a large number of changes to data upon which bitmapped indexes are based, a method and apparatus for updating bitmapped indexes to reflect a large number of changes made to the data upon which the bitmapped indexes are based which reduces the resources required to make the changes to the bitmapped indexes are highly desirable.